package com.air.repo.jdk8;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * Place Function on Here:
 *
 * @author yh 2018/8/17 17:49
 * @since: Jdk 1.8
 */
public class TestJoin {

    static  Thread  thread1=new Thread(new Runnable() {
        public void run() {
            System.out.println(Thread.currentThread().getId()+"---A");

        }
    });
    static  Thread  thread2=new Thread(new Runnable() {
        public void run() {
            System.out.println(Thread.currentThread().getId()+"---B");
        }
    });
    static  Thread  thread3=new Thread(new Runnable() {
        public void run() {
            System.out.println(Thread.currentThread().getId()+"---C");
        }
    });

    static ExecutorService executorService= Executors.newFixedThreadPool(3);

    public static void main(String[] args) {
        for(int i=0;i<4;i++){
            executorService.submit(thread1);
            executorService.submit(thread2);
            executorService.submit(thread3);
            System.out.println("====================");
        }
        executorService.shutdown();
    }
}
